package com.ttuproject.ttu.advice;

import com.ttuproject.ttu.exception.Advice;
import lombok.Data;

/**
 * 拿到枚举中的参数
 */
@Data
public class ExceptionResult {
    private int code;
    private String message;
    private Long timestamp;

    public ExceptionResult(Advice advice){
        this.code = advice.getCode();
        this.message = advice.getMsg();
        this.timestamp = System.currentTimeMillis();
    }
    public ExceptionResult(int code, String message){
        this.code = code;
        this.message = message;
        this.timestamp = System.currentTimeMillis();
    }
}
